require('./PageYeji.less');
import { Control, Route } from 'react-keeper';
import React,{Component} from 'react';
import Reflux from 'reflux';
import ReactMixin from 'react-mixin';
import YejiInfo from '../../../components/yeji/YejiInfo';
import Actions from './Actions'
import Store from './Store';
import 'weui';
import { Tab,TabBarItem,TabBar,Page,Article,
  Panel,
  PanelHeader,
  PanelBody,
  PanelFooter,
  MediaBox,
  MediaBoxHeader,
  MediaBoxBody,
  MediaBoxTitle,
  MediaBoxDescription,
  MediaBoxInfo,
  MediaBoxInfoMeta,
  Cells,
  Cell,
  CellHeader,
  CellBody,
  CellFooter,
  Flex,
  FlexItem,
  Grids
} from  'react-weui/build/packages'




class Yeji extends Component {
    constructor(props) {
      super(props);
      this.state = {
        actshow: false
      }
      this.handleChange = this.handleChange.bind(this);
      this.myHome = this.myHome.bind(this);
    }

    handleChange(key){
        //this.dispatch('setTabbarIndex',key);
        //Control.go(this.state.menu[key].path, ); // keeper的跳转
    }

  myHome() {
    Control.go('/home');
  }

    render() {
      const t = this;
        return (
          <div className="page yeji">
            <YejiInfo engls={t.state.yeji.engls} />

          </div>
        );
    }

  componentWillMount() {
    Actions.engInit();
  }

  componentDidMount() {
  }

  shouldComponentUpdate(nextProps = {}, nextState = {}) {
    const thisProps = this.props || {},
      thisState = this.state.yeji || {};

    if (Object.keys(thisProps).length !== Object.keys(nextProps).length ||
      Object.keys(thisState).length !== Object.keys(nextState).length) {
      return true;
    }

    for (const key in nextProps) {
      if (thisProps[key] !== nextProps[key] || !is(thisProps[key], nextProps[key])) {
        console.log(thisProps[key], nextProps[key]);
        return true;
      }
    }

    for (const key in nextState) {
      if (thisState[key] !== nextState[key] || !is(thisState[key], nextState[key])) {
        return true;
      }
    }

    return true;
  }



}

ReactMixin.onClass(Yeji, Reflux.connect(Store, 'yeji'));

export default Yeji ;
